/*
                  InterfaceLobby Class Definition
*/

#ifndef INTERFACELOBBY_H
#define INTERFACELOBBY_H

#include <boost/lexical_cast.hpp>

#include "Interface.h"
#include "GUISystem/PlayersetupFrame.h"
#include "MapInfo.h"
#include "SnakeEngine.h"

using boost::lexical_cast;
using boost::bad_lexical_cast;

class InterfaceLobby : public Interface
{
    public:
        InterfaceLobby(InterfaceType NewType);
        ~InterfaceLobby();

        int Initialise();
        InterfaceType HandleInput(const SDL_Event& event);
        int Draw(SDL_Surface *surface);

        InterfaceType CheckWidgetEvents();

    protected:
        InterfaceType Type;

        FrameGroup frmgLobby;
        PlayersetupFrame *frmPlayer1;
        PlayersetupFrame *frmPlayer2;
        PlayersetupFrame *frmPlayer3;
        PlayersetupFrame *frmPlayer4;
        PlayersetupFrame *frmPlayer5;
        PlayersetupFrame *frmPlayer6;

        Frame *frmMap;
        Imagebox *imgPreview;
        Imagebox *imgBorder;
        Listbox *lstMaplist;
        Label *lblMap;
        Label *lblPlayers;
        Label *lblSize;
        Label *lblGametype;
        Listbox *lstGametype;
        Label *lblScorelimit;
        TextBox *txtScorelimit;
        Label *lblStartSize;
        TextBox *txtStartSize;
        Label *lblFoodCount;
        TextBox *txtFoodCount;

        Frame *frmOptionbar;
        Button *btnBack;
        Button *btnStart;

        Imagebox imgBackground;

        void RefreshMapInfo();
        void RefreshPlayerInfo();
        void AddPlayerToGame(const int& iSlot);

        PlayersetupFrame* GetPlayerFrame(const int& id);
};

#endif
